package com.situ.util;

import java.util.List;

public class Page<T> {
    private List<T> content; // 当前页的数据
    private int page;        // 当前页码
    private int pageSize;    // 每页条数
    private int totalPages;  // 总页数
    private long totalItems; // 总条数

    // 构造函数
    public Page(List<T> content, int page, int pageSize, long totalItems) {
        this.content = content;
        this.page = page;
        this.pageSize = pageSize;
        this.totalItems = totalItems;
        this.totalPages = (int) Math.ceil((double) totalItems / pageSize);
    }

    // Getter 方法
    public List<T> getContent() {
        return content;
    }

    public int getPage() {
        return page;
    }

    public int getPageSize() {
        return pageSize;
    }

    public int getTotalPages() {
        return totalPages;
    }

    public long getTotalItems() {
        return totalItems;
    }
}












































